const express=require("express");
const router=express.Router();
const articel=require("../model/article");

router.get("/",(req,res)=>{
    res.render("markdown",{
        articel:"",
        user:req.session.user,
    })
})

router.get("/modify/:id",(req,res)=>{
    articel.findById(req.params.id).then(result=>{
        res.render("markdown",{
            articel:result,
            user:req.session.user,
        })
    })
})

module.exports=router;